package com.disapand.strongarmy.service

import com.disapand.strongarmy.model.*
import com.disapand.strongarmy.vo.*

/**
 *
 * @auth disapand
 * @date 2021/10/26 - 16:48 - 星期二
 *
 */
interface PermissionService {

    /**
     * 新增权限
     *
     * @param group
     * @param label
     * @param method
     * @param permission
     * @return
     */
    fun add(group: String, label: String, method: String, permission: String): Boolean

    /**
     * 获取权限
     *
     * @param permission
     * @return
     */
    fun get(permission: String): Permission?

    /**
     * 获取所有权限
     *
     * @return
     */
    fun get(current: Int, pageSize: Int): PageVO<Permission>

    /**
     * 获取所有权限
     *
     * @return
     */
    fun get(): List<Permission>

    /**
     * 获取所有权限组
     *
     * @return
     */
    fun getPermissionAllGroup(): List<Map<String, String?>>

    /**
     * 根据权限组获取本组权限的成员
     *
     * @param group
     * @return
     */
    fun getPermissionByGroup(group: String, current: Int, pageSize: Int): PageVO<Permission>

    /**
     * 新增或更新权限
     *
     * @param group
     * @param label
     * @param method
     * @param permission
     * @return
     */
    fun addOrUpdate(group: String, groupLabel: String, label: String, method: String, permission: String): Boolean
}